package com.tengju.bff.interfaces.covercharge.service;

import com.tengju.bff.interfaces.covercharge.constant.CoverChargeEnum;
import com.tengju.bff.interfaces.covercharge.constant.WithdrawalCancelEnum;
import com.tengju.bff.interfaces.covercharge.dto.BankInfo;
import com.tengju.bff.interfaces.covercharge.dto.WithdrawalModify;
import com.tengju.bff.interfaces.covercharge.entity.vo.WithdrawalApply;
import com.tengju.bff.interfaces.covercharge.entity.vo.WithdrawalApplyBeforeResult;
import com.tengju.bff.interfaces.covercharge.entity.vo.WithdrawalApplyInfoResult;
import com.tengju.settlement.domain.model.account.UserIdCode;
import com.tengju.settlement.domain.model.depository.DepositoryAccount;
import com.tengju.user.domain.model.archive.IdCardNo;
import com.tengju.user.domain.model.archive.letax.IdentityType;
import com.tengju.user.domain.model.archive.letax.LetaxAccount;
import com.tengju.user.domain.model.archive.letax.LetaxSnapshot;
import com.tengju.user.domain.model.archive.letax.LetaxWithdrawId;
import com.tengju.user.domain.model.archive.sign.Sign;
import com.tengju.user.domain.shared.AccountId;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 乐税个体户service
 * </p>
 *
 * @author zhaoyi
 * @since 2020-02-24
 */
public interface LeTaxOneService {

    /**
     * 查询个体申请前信息
     *
     * @param accountType 账户类型
     * @param idCode      idCode
     */
    WithdrawalApplyBeforeResult queryWithdrawalApplyBefore(CoverChargeEnum.ServiceAccountType accountType, Integer idCode);

    /**
     * 查询个体申请信息
     *
     * @param accountType 账户类型
     * @param idCode      idCode
     * @param amount      申请金额
     */
    WithdrawalApplyInfoResult queryWithdrawalApplyInfo(CoverChargeEnum.ServiceAccountType accountType, Integer idCode, BigDecimal amount);

    /**
     * 个体提现申请
     *
     * @param accountType     账户类型
     * @param idCode          idCode
     * @param withdrawalApply withdrawalApply
     */
    Integer withdrawalApply(CoverChargeEnum.ServiceAccountType accountType, Integer idCode, WithdrawalApply withdrawalApply, DepositoryAccount depositoryAccount);

    /**
     * 个体提现申请取消
     *
     * @param idCode       idCode
     * @param platformCode 平台编号
     */
    int withdrawalApplyCancel(Integer idCode, String platformCode, Integer applyId, WithdrawalCancelEnum withdrawalCancelEnum);

    int withdrawalApplyCancelNoTran(Integer idCode, String platformCode, Integer applyId, WithdrawalCancelEnum withdrawalCancelEnum);

    /**
     * 个体提现申请修改
     */
    void withdrawalApplyModify(WithdrawalModify withdrawalModify);

    void updateOthersCycleAdd(Date nowDate, Integer idCode, Integer accountId, BigDecimal applyMoney);

    /**
     * 个体提现申请理由修改
     *
     * @param idCode 代理id
     * @param platformCode 平台
     * @param withdrawalApply withdrawalApply
     */
    Integer updateApplyReason(Integer idCode,String platformCode, WithdrawalApply withdrawalApply);

    /**
     * 认证成功通知会员
     * @param idCode
     * @param checkTime
     * @param sign
     */
    void signSuccessToNoticeMember(UserIdCode idCode, LocalDateTime checkTime, Sign sign);

    /**
     * 修改个体户提现记录
     * @param idCode
     * @param currentIdentity
     */
    void modifyRegisteredWithdrawalRecords(UserIdCode idCode, IdentityType currentIdentity);

    /**
     * 修改个体户提现记录
     * @param idCode
     * @param currentIdentity
     * @param letaxWithdrawId
     * @param bankInfo
     */
    void modifyRegisteredWithdrawalRecords(UserIdCode idCode, IdentityType currentIdentity,
            LetaxWithdrawId letaxWithdrawId, BankInfo bankInfo);

    void register(com.tengju.user.domain.model.user.UserIdCode idCode, AccountId accountId, LetaxAccount letaxAccount, LetaxSnapshot snapshot);

    /**
     * 判断身份证号和银行账户是否被使用
     * @param idCode
     * @param idCardNo
     * @param idCardName
     * @param bankNo
     */
    void idcardAndBank(UserIdCode idCode, IdCardNo idCardNo, String idCardName, String bankNo);
}
